<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.*"%>
<%@ page import="com.fc.util.*" %>
<%@ page import="com.fc.model.*" %>
<%@ page import="com.fc.control.*" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>worker_add_do.jsp</title>
	</head>

	<body>
		<%
		request.setCharacterEncoding("UTF-8");
		int id = Integer.parseInt(request.getParameter("id"));
  		String position=ParamUtil.getString(request,"position",null);
  		int wages=ParamUtil.getInt(request,"wages",0);
  		
  		Worker worker=new Worker();
  		
		worker.setPosition(position);
		worker.setWages(wages);

  		if(WorkerControl.updateWorker(worker,id))
  			{
  				%>
	<script language="javascript">
  				alert("修改成功");
  				window.location.href="worker.jsp";
  				</script>
		<%} else { %>
		<script language="javascript">
  				alert("修改失败");
  				history.back(-1);
  				</script>
		<%} 
   %>
	</body>
</html>
